<?php

namespace Xrfg\Api\Trading\Home\Resources;

use App\Http\Resources\Resource;
use Xrfg\Api\Trading\Home\Repositories\CoinPriceRepository;

class CoinToUsdtResource extends Resource
{
    /**
     * Transform the resource collection into an array.
     *
     * @param \Illuminate\Http\Request $request
     *
     * @return array
     */
    public function toArray($request)
    {
        return [
            'coin_name' => $this->name,
            'coin_to_usdt' => strval((new CoinPriceRepository())->coinToUsdt($this->name)),
        ];
    }
}
